import java.util.Arrays;

/**
 * Created with Intellij IDEA.
 * Description;
 * User:墨琦
 * Data:2023-03-14
 * Time:17:45
 */
public class main1 {
    public static void acc(int[] array)
    {
        int b= array.length-1;
        for(int i=0;i<array.length;i++)
        {
            if(array[i]%2==0)
            {
                for(;b>=0;b--)
                {
                    if(array[b]%2!=0)
                    {
                        array[i]=array[i]^array[b];
                        array[b]=array[i]^array[b];
                        array[i]=array[i]^array[b];
                        break;
                    }

                }
            }
            if(i>b)
            {
                break;
            }
        }
    }
    public static void main(String[] args) {
        int[] array=new int[]{1,3,2,4,5,6,7,8,9};
        acc(array);
        System.out.println(Arrays.toString(array));
    }
}
